﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
	<meta http-equiv="pragma" content="no-cache">
	<title>爱音乐春季运动会</title>
	<script src="./lib/jquery/jquery-1.9.1.min.js"></script>
	<script src="tool/config.js"></script>
	<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_"+SITE_ID+"'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/z_stat.php%3Fid%3D"+SITE_ID+"' type='text/javascript'%3E%3C/script%3E"));</script>
	<script type="text/javascript">
		var _czc = _czc || [];
		_czc.push(["_setAccount", SITE_ID]);
		$("#cnzz_stat_icon_"+SITE_ID).css({display:"none"});
	</script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript">
		$(function(){
			var jssdk = window.jssdk;
			wx.config({
				debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
				appId: jssdk.appId, // 必填，公众号的唯一标识
				timestamp: jssdk.timestamp, // 必填，生成签名的时间戳
				nonceStr: jssdk.nonceStr, // 必填，生成签名的随机串
				signature: jssdk.signature,// 必填，签名，见附录1
				jsApiList: [
					'onMenuShareTimeline',
					'onMenuShareAppMessage',
					'onMenuShareQQ',
					'onMenuShareWeibo'
				] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
			});

			wx.ready(function() {
				wx.onMenuShareAppMessage({
					title: "我在爱音乐春季运动会达到"+window.localStorage.getItem("score")+"分，够胆来挑，狗蛋勿点",
					desc:  window["shareObj"].decstr,
					link:  window["shareObj"].linkstr,
					imgUrl:  window["shareObj"].iconstr,
					trigger: function (res) {
					},
					success: function (res) {
					},
					cancel: function (res) {
					},
					fail: function (res) {
					}
				});
				//分享到朋友圈
				wx.onMenuShareTimeline({
					title: "我在爱音乐春季运动会达到"+window.localStorage.getItem("score")+"分，够胆来挑，狗蛋勿点",
					link:  window["shareObj"].linkstr,
					imgUrl:  window["shareObj"].iconstr,
					trigger: function (res) {
					},
					success: function (res) {
					},
					cancel: function (res) {
					},
					fail: function (res) {
					}
				});
			});
			wx.error(function (res) {
				console.log(res.errMsg);
			});
		});

		function canplaythrough(){
			window.audio1loaded = "1";
		}

		function canplaythrough2(){
			window.audio2loaded = "1";
		}

		setInterval(function(){
			if(window.localStorage.getItem("gameStatus")=="1"){
				document.getElementById("audio1").currentTime = 0;
				document.getElementById("audio1").play();
				document.getElementById("audio2").pause();
				window.localStorage.setItem("gameStatus","0");
			}
			if(window.localStorage.getItem("gameStatus")=="2"){
				document.getElementById("audio2").currentTime = 0;
				document.getElementById("audio1").pause();
				document.getElementById("audio2").play();
				window.localStorage.setItem("gameStatus","0");
			}
			if(window.localStorage.getItem("showFollow")=="1"){
				$("#focus2").show();
//				$("#c2canvasdiv").hide();
				window.localStorage.setItem("showFollow","0");
			}
		},500);
		function trackGoToLottery(){
			_czc.push(["_trackEvent","游戏结束页","获得抽奖机会按钮","","",""]);
		}
		function trackRestart(){
			_czc.push(["_trackEvent","游戏结束页","不服再战","","",""]);
		}
		function trackGoToFocus(){
			_czc.push(["_trackEvent","游戏结束页","关注","","",""]);
		}
		function trackShare(){
			_czc.push(["_trackEvent","游戏结束页","分享","","",""]);
		}
	</script>
	<!-- Standardised web app manifest -->
	<link rel="manifest" href="appmanifest.json" />
	
	<!-- Allow fullscreen mode on iOS devices. (These are Apple specific meta tags.) -->
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<link rel="apple-touch-icon" sizes="256x256" href="icon-256.png" />
	<meta name="HandheldFriendly" content="true" />
	
	<!-- Chrome for Android web app tags -->
	<meta name="mobile-web-app-capable" content="yes" />
	<link rel="shortcut icon" sizes="256x256" href="icon-256.png" />

    <!-- All margins and padding must be zero for the canvas to fill the screen. -->
	<style type="text/css">
		* {
			padding: 0;
			margin: 0;
		}
		html, body {
			background: #000;
			color: #fff;
			overflow: hidden;
			touch-action: none;
			-ms-touch-action: none;
		}
		canvas {
			touch-action-delay: none;
			touch-action: none;
			-ms-touch-action: none;
		}
    </style>
	

</head> 
 
<body>
<div data-role="page" style="width: 100%;height: 100%;position: absolute;background-image: url(images/luckypage.png); background-size: cover; background-repeat: no-repeat;display: none;" id="focus2">
	<div data-role="main" class="ui-content" style="padding:15px;position:fixed;top:10%;left:2%;right:2%;background-image: url(images/background.png);background-repeat: no-repeat;background-size: 100% 100%;height: 358px;">
		<a href="javascript:void(0);" style="float: right;" onclick="document.getElementById('focus2').style.display='none';document.getElementById('c2canvasdiv').style.display='';"><img src="./images/close.png" style="width: 30px;"></a>
		<img src="image/qrcode.png" style="position: absolute;top:15%;left: 15%;width: 70%;">
		<!-- <a href="#" style="position: absolute;bottom: 3%;left: 50%;margin-left: -78px;"><img src="images/share.png" width="156px" height="60px"></a> -->
		<p style="position: absolute;bottom: 5%;left: 50%;margin-left: -86px;font-weight: bold;">长按二维码可关注公众号</p>
	</div>
</div>
<audio src="./media/bgm.mp3" id="audio1" loop="loop" oncanplaythrough="canplaythrough();"></audio>
<audio src="./media/end.mp3" id="audio2" oncanplaythrough="canplaythrough2();"></audio>
	<div id="fb-root"></div>
	
	<script>
	// Issue a warning if trying to preview an exported project on disk.
	(function(){
		// Check for running exported on file protocol
		if (window.location.protocol.substr(0, 4) === "file")
		{
			alert("Exported games won't work until you upload them. (When running on the file:/// protocol, browsers block many features from working for security reasons.)");
		}
	})();
	</script>
	
	<!-- The canvas must be inside a div called c2canvasdiv -->
	<div id="c2canvasdiv">
	
		<!-- The canvas the project will render to.  If you change its ID, don't forget to change the
		ID the runtime looks for in the jQuery events above (ready() and cr_sizeCanvas()). -->
		<canvas id="c2canvas" width="750" height="1200">
			<!-- This text is displayed if the visitor's browser does not support HTML5.
			You can change it, but it is a good idea to link to a description of a browser
			and provide some links to download some popular HTML5-compatible browsers. -->
			<h1>Your browser does not appear to support HTML5.  Try upgrading your browser to the latest version.  <a href="http://www.whatbrowser.org">What is a browser?</a>
			<br/><br/><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx">Microsoft Internet Explorer</a><br/>
			<a href="http://www.mozilla.com/firefox/">Mozilla Firefox</a><br/>
			<a href="http://www.google.com/chrome/">Google Chrome</a><br/>
			<a href="http://www.apple.com/safari/download/">Apple Safari</a><br/>
			<a href="http://www.google.com/chromeframe">Google Chrome Frame for Internet Explorer</a><br/></h1>
		</canvas>
		
	</div>
	
	<!-- Pages load faster with scripts at the bottom -->
	
	<!-- Construct 2 exported games require jQuery. -->
	<script src="jquery-2.1.1.min.js"></script>


	
    <!-- The runtime script.  You can rename it, but don't forget to rename the reference here as well.
    This file will have been minified and obfuscated if you enabled "Minify script" during export. -->
	<script src="c2runtime.js"></script>

    <script>
		// Size the canvas to fill the browser viewport.
		jQuery(window).resize(function() {
			cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
		});
		
		// Start the Construct 2 project running on window load.
		jQuery(document).ready(function ()
		{			
			// Create new runtime using the c2canvas
			cr_createRuntime("c2canvas");
		});
		
		// Pause and resume on page becoming visible/invisible
		function onVisibilityChanged() {
			if (document.hidden || document.mozHidden || document.webkitHidden || document.msHidden)
				cr_setSuspended(true);
			else
				cr_setSuspended(false);
		};
		
		document.addEventListener("visibilitychange", onVisibilityChanged, false);
		document.addEventListener("mozvisibilitychange", onVisibilityChanged, false);
		document.addEventListener("webkitvisibilitychange", onVisibilityChanged, false);
		document.addEventListener("msvisibilitychange", onVisibilityChanged, false);
		
		if (navigator.serviceWorker && navigator.serviceWorker.register)
		{
			// Register an empty service worker to trigger web app install banners.
//			navigator.serviceWorker.register("sw.js", { scope: "./" });
		}
    </script>
<script>
	var ele = document.getElementById("c2canvas");
	$(window).resize(function() {
		ele.style.transform = "scale("+(document.body.clientWidth/ele.style.width.replace("px",""))+")";
	});
	console.log("123");
</script>
</body> 
</html> 